package com.nanhang.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;


@Data
public class Student implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "sid", type = IdType.AUTO)
    private Integer sid;

    private String sname;

    private String sex;

    private Integer age;

    private String addr;

    private Integer cid;

    @TableField(exist = false)   // 说明不存在此字段
    private String cname;

    // 逻辑删除字段
    @TableLogic
    private Integer deleted;

    // 自动填充配置
    @TableField(fill = FieldFill.INSERT)            // 插入数据时填充
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)     // 插入和修改时都会填充
    private LocalDateTime updateTime;

}
